package fantasyday.wowzolo.service;

import fantasyday.wowzolo.dao.AccountDao;
import fantasyday.wowzolo.domain.Account;

public class AccountService {
	private AccountDao _accountDao;

	public void setAccountDao(AccountDao accountDao) {
		_accountDao = accountDao;
	}

	public Account getAccount(String username) {
		return _accountDao.getAccount(username);
	}

	public Account getAccount(Account account) {
		return _accountDao.getAccountByUsernameAndPassword(account);
	}

	public void insertAccount(Account account) {
		_accountDao.insertAccount(account);
        _accountDao.insertProfile(account);
        _accountDao.insertSignon(account);
    }

	public void updateAccount(Account account) {
		_accountDao.updateAccount(account);
		_accountDao.updateProfile(account);
        _accountDao.updateSignon(account);
    }
}